let obj =document.getElementsByClassName('bottom')[0];

let sidebarComponent=(function(){

    function logout() {
        $.ajax("api.php/logout", {
            type: "GET",
            dataType: "json",
            success: function (res, status_code) {
                console.log(res);
                if (res["code"] === 200) {
                    localStorage.clear();
                    location.assign('./index.html');
                }
            },
            error: function () {
                alert('失败');
            }
        });
    }

    $("obj a").logoutClick("click",function (e){
        console.log("1");
    });



    return {
        logoutClick:logoutClick
    }
})();

sidebarComponent.logoutClick();